#!/bin/sh
#
#==============================================================
#  Script: uncde
#==============================================================
#
#  This script is copied verbatim from question 2.8 Tcl/Tk 
#  of the Tcl/Tk FAQ. It will temporarily remove those lame 
#  global resource bindings that screw with Tk applications. 
#  It launches the Tk app (which is assumed to be in your 
#  path), gives it a few seconds to load up, then restores 
#  the old rescources.
#
#  Example usage:  uncde tkcon -slave "set a 50"

if test ! "$1"; then
   echo "usage: $0 command options"
   exit
fi

# Cache the old resources

OLD_RESOURCES = `xrdb -query`

# Remove what we don't want

echo "removing *foreground, *background, and *Font resources"
xrdb -remove << STOP
*foreground:
*Font:
*background:
STOP

exec ${1+"$@"} &
echo "\"$1\" backgrounded as process $!"

# Add back the old stuff

echo "resetting all resources to defaults"
xrdb -merge << STOP
$OLD_RESOURCES
STOP
